import { BasicColumn } from '@/components/Table';
import { FormSchema } from '@/components/Table';
export const columns: BasicColumn[] = [
  {
    title: '字典名称',
    align: 'center',
    dataIndex: 'label',
  },
  {
    title: '字典编码',
    align: 'center',
    dataIndex: 'value',
  },
];

export const searchFormSchema: FormSchema[] = [];

export const formSchema: FormSchema[] = [
  {
    field: 'id',
    label: '',
    component: 'Input',
    show: false,
  },
  {
    field: 'pid',
    label: '上级',
    component: 'ApiTreeSelect',
    required: true,
    componentProps: {
      treeDefaultExpandAll: true,
      fieldNames: {
        label: 'title',
        key: 'id',
        value: 'id',
      },
      getPopupContainer: () => document.body,
      showSearch: true,
      treeNodeFilterProp: 'title',
    },
  },
  {
    field: 'label',
    label: '字典名称',
    component: 'Input',
    required: true,
  },
  {
    field: 'value',
    label: '字典编码',
    component: 'Input',
    required: true,
  },
];
